<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>编辑供应商</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<link rel="stylesheet" href="admin/css/common.css" type="text/css" />
	<link rel="stylesheet" href="admin/css/provider.css" type="text/css" />
	<script type="text/javascript" src="admin/js/province-city.js"></script>
	<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
	<script type="text/javascript">
		<!--
		var s=["s1","s2"];
		var opt0 = ["省份","地级市"];
		function setup()
		{
		 for(i=0;i<s.length-1;i++)
		  document.getElementById(s[i]).onchange = new Function("change("+(i+1)+")");
		  change(0);
		}

		//判断是否为空
		function check(){
			//检查图片
			var fileext = document.getElementById("iconFile").value.substring(document.getElementById("iconFile").value.lastIndexOf("."),document.getElementById("iconFile").value.length);
			fileext=fileext.toLowerCase();
			if ((fileext!='.jpg')&&(fileext!='.gif')&&(fileext!='.jpeg')&&(fileext!='.png')&&(fileext!='.bmp')){
				alert("对不起，系统仅支持标准格式的照片，请您调整格式后重新上传，谢谢 !");
				$('#iconFile').focus();
				return false;
			}else{
				$('#iconFileName').val(fileext);
			}
			return true;
		}
		//-->
	</script>
  </head>
  <body>
  	<div id="provider_zone">
  	  <form action="provider/updateProvider.action?type=photo" method="post" enctype="multipart/form-data" onsubmit="return check();">
		  <table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">
		    <tr>
		      <td width="18%" class="left_title_1">供应商名字</td>
		      <td width="82%">
		   	   		${provider.name }
		      </td>
		    </tr>
		    <tr>
		      <td class="left_title_2">供应商原始缩略图</td>
		      <td>
				<img alt="${provider.name }原始图片"  width="200px" height="200px" src="upload/provider/${provider.photo }"  title="${provider.name }原始图片"/>
		      </td>
		    </tr>
		    <tr>
		      <td class="left_title_1">供应商新图片</td>
		      <td>
					<input type="file" class="input-file" name="iconFile" id="iconFile">
					<input type="hidden" id="iconFileName" name="iconFileName">
		      </td>
		    </tr>
		    
		    <tr>
		    	<td colspan="2" style="padding-left: 560px;">
					<input type="submit" class="input-submit" value="保存更新">
					<input type="hidden" value="${provider.id }" name="providerId" id="providerId" />
					<input type="hidden" value="${provider.id }" name="provider.id" id="provider.id" />
				</td>
		    </tr>
		    
		  </table>
	  </form>
	</div>
  </body>
</html>
